<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/7/21
 * Time: 17:18
 */
header("Content-Type: text/plain;charset=utf-8");
header("Access-Control-Allow-Origin:*");
header("Access-Control-Methods:POST,GET");


require_once ('../com/dao/userDao.php');

$account = $_POST['account'];

$accountExist = null;

$userDao = new UserDao();
$res = $userDao->selectAccount($account);
while($respResult = mysqli_fetch_assoc($res)){
    $accountExist[] = $respResult;
}
if($accountExist==null){
    $result = array('key'=>'ok');
}else{
    $result = array('key'=>'exist');
}

echo json_encode($result,JSON_UNESCAPED_UNICODE);